export default{
	namespaced:true,
	state:{
		MoneySymbol:uni.getStorageSync("MoneySymbol")||"￥",
		typeTag:uni.getStorageSync("typeTag")||"A",
		popupBg:uni.getStorageSync("popupBg")||false,
		inputArea:uni.getStorageSync("inputArea")||false,
		showYusuan:uni.getStorageSync("showYusuan")||false,
	},
	mutations:{
		saveSetting(state){
			if(state.MoneySymbol!=uni.getStorageSync("MoneySymbol")){
				uni.setStorageSync('MoneySymbol',state.MoneySymbol)
			}
			if(state.typeTag!=uni.getStorageSync("typeTag")){
				uni.setStorageSync('typeTag',state.typeTag)
			}
			if(state.popupBg!=uni.getStorageSync("popupBg")){
				uni.setStorageSync('popupBg',state.popupBg)
			}
			if(state.inputArea!=uni.getStorageSync("inputArea")){
				uni.setStorageSync('inputArea',state.inputArea)
			}
			if(state.showYusuan!=uni.getStorageSync("showYusuan")){
				uni.setStorageSync('showYusuan',state.showYusuan)
			}
		},
		changeMoneySymbol(state,icon){
			state.MoneySymbol=icon
			this.commit("setting/saveSetting")
		},
		changeTypeTag(state,tag){
			state.typeTag=tag
			this.commit("setting/saveSetting")
		},
		changePopupBg(state,falg){
			state.popupBg=falg
			this.commit("setting/saveSetting")
		},
		changeInputArea(state,falg){
			state.inputArea=falg
			this.commit("setting/saveSetting")
		},
		changeShowYusuan(state,falg){
			state.showYusuan=falg
			this.commit("setting/saveSetting")
		}
	}
}